package com.eplatform.common.utils;

import java.util.List;
import java.util.Map;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;

public class ExtData {
	public static class TreeData {
	public static<T>  Object getTreeMap(List<T> lists,Map model){
		List<TreeDataEntiy> result=Lists.newArrayList();
		Map kvMap=Maps.newHashMap();
		kvMap.put("id", "id");
		kvMap.put("text", "name");
		kvMap.put("hrefTarget", "target");
		if(lists.size()>0){
			Object obj=lists.get(0);
			return result;
		}
		return null;
	}
	private static<T> Map injectRecursion(List<T> lists,T t,Map m){
		Map<String,Object> map=Maps.newHashMap();
		 for (Object entry : m.keySet()) {
			  }
		 return null;
	}
	
}
public static class Result{
	public static Map Success=Maps.newHashMap();
	static{
		Success.put("success", true);
	}
	public static Map SuccessData(Object data){
		Map result=Maps.newHashMap();
		result.put("success", true);
		result.put("data", data);
		return result;
	}
	public static Map Error(String message){
		Map result=Maps.newHashMap();
		result.put("success", false);
		result.put("data", message);
		return result;
	}
}
	public class TreeDataEntiy{
		private boolean allowDrag=false;
		
		private boolean allowDrop=false;
		
		private String link;
		
		private List<TreeDataEntiy> children;
		
		private Map<String,String> attributes;
		
		private String cls;
		
		private boolean expanded=true;
		
 		private String href;
		
		private String hrefTarget;
		
		private String icon;
		
		private String iconCls;
		
		private boolean leaf;
		
		private String qtip;
		
		private boolean root=false;
		
		private String text;
		
		private String id;
		
		private Object rawData;

		public boolean isAllowDrag() {
			return allowDrag;
		}

		public void setAllowDrag(boolean allowDrag) {
			this.allowDrag = allowDrag;
		}

		public boolean isAllowDrop() {
			return allowDrop;
		}

		public void setAllowDrop(boolean allowDrop) {
			this.allowDrop = allowDrop;
		}


		public List<TreeDataEntiy> getChildren() {
			return children;
		}

		public void setChildren(List<TreeDataEntiy> children) {
			this.children = children;
		}

		public String getCls() {
			return cls;
		}

		public void setCls(String cls) {
			this.cls = cls;
		}

		public String getHref() {
			return href;
		}

		public void setHref(String href) {
			this.href = href;
		}

		public String getHrefTarget() {
			return hrefTarget;
		}

		public void setHrefTarget(String hrefTarget) {
			this.hrefTarget = hrefTarget;
		}

		public String getIcon() {
			return icon;
		}

		public void setIcon(String icon) {
			this.icon = icon;
		}

		public String getIconCls() {
			return iconCls;
		}

		public void setIconCls(String iconCls) {
			this.iconCls = iconCls;
		}

		public boolean isLeaf() {
			return leaf;
		}

		public void setLeaf(boolean leaf) {
			this.leaf = leaf;
		}

		public String getQtip() {
			return qtip;
		}

		public void setQtip(String qtip) {
			this.qtip = qtip;
		}

		public boolean isRoot() {
			return root;
		}

		public void setRoot(boolean root) {
			this.root = root;
		}

		public String getText() {
			return text;
		}

		public void setText(String text) {
			this.text = text;
		}

		public String getId() {
			return id;
		}

		public void setId(String id) {
			this.id = id;
		}

		public Map<String,String> getAttributes() {
			return attributes;
		}

		public void setAttributes(Map<String,String> attributes) {
			this.attributes = attributes;
		}

		public String getLink() {
			return link;
		}

		public void setLink(String link) {
			this.link = link;
		}

		public boolean isExpanded() {
			return expanded;
		}

		public void setExpanded(boolean expanded) {
			this.expanded = expanded;
		}
		
		public void setRawData(Object rawData){
			this.rawData=rawData;
		}
		
		public Object getRawData(){
			return this.rawData;
		}
	}
}
